OPC-UA Embedded Server SDK  2.1.0
Date, Time and Standard Library Functions

Functions

uint32_t UAServer_Callback_millisecond (void)
 
int64_t UAServer_Callback_datetime (void)
 
uint32_t UAServer_Callback_pseudeo_random_number (void)
 
void * UAServer_Callback_memcpy (void *destination, const void *source, size_t num)
 
void * UAServer_Callback_memchr (const void *ptr, int32_t value, size_t num)
 
void * UAServer_Callback_memset (void *ptr, int32_t value, size_t num)
 
int UAServer_Callback_memcmp (const void *ptr1, const void *ptr2, size_t num)
 
char * UAServer_Callback_strncpy (char *destination, const char *source, size_t num)
 
void * UAServer_Callback_malloc (size_t size)
 
void UAServer_Callback_free (void *ptr)
 

Detailed Description

Function Documentation

uint32_t UAServer_Callback_millisecond ( void  )

Function provided by host to enable library to time its internal operations

The library requires a millisecond timer in order to operate. This timer is implemented via a uint32_t which increments every millisecond. The host must implement this function as it is called periodically by the stack.

Returns
A counter that increments every millisecond.
int64_t UAServer_Callback_datetime ( void  )

Function provided by host to enable library to obtain current date and time

The library requires the current date and time in order to operate. This timer is implemented via an int64_t which represents UTC time and data in accordance with Windows FILETIME. This is the number of 100ns intervals since January 1, 1601. The host must implement this function as it is called periodically by the library.

Returns
Current date and time.
uint32_t UAServer_Callback_pseudeo_random_number ( void  )

Function provided by host to provide pseudo-random numbers

The library requires a pseudo-random number generator in order to operate. The host must implement this function as it is called periodically by the library.

Returns
A pseudo-random number.
void* UAServer_Callback_memcpy ( void *  destination,
const void *  source,
size_t  num 
)

Function provided by host to provide a memcpy implementation

Some platforms can dramatically improve the performance of memcpy for large data blocks by using DMA or other techniques. If required, a custom implementation may be inserted here. Where a custom implementation is not required simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]destinationPointer to the destination array where the content is to be copied, type-casted to a pointer of type void*.
[in]sourcePointer to the source of data to be copied, type-casted to a pointer of type const void*.
[in]numNumber of bytes to copy. size_t is an unsigned integral type.
Returns
"destination" is returned.
void* UAServer_Callback_memchr ( const void *  ptr,
int32_t  value,
size_t  num 
)

Function provided by host to provide a memchr implementation

Simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]ptrPointer to the block of memory where the search is performed.
[in]valueValue to be located. The value is passed as an int, but the function performs a byte per byte search using the unsigned char conversion of this value.
[in]numNumber of bytes to be analyzed. size_t is an unsigned integral type.
Returns
A pointer to the first occurrence of value in the block of memory pointed by ptr. If the value is not found, the function returns a null pointer.
void* UAServer_Callback_memset ( void *  ptr,
int32_t  value,
size_t  num 
)

Function provided by host to provide a memset implementation

Simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]ptrPointer to the block of memory to fill.
[in]valueValue to be set. The value is passed as an int, but the function fills the block of memory using the unsigned char conversion of this value.
[in]numNumber of bytes to be set to the value. size_t is an unsigned integral type.
Returns
"ptr" is returned.
int UAServer_Callback_memcmp ( const void *  ptr1,
const void *  ptr2,
size_t  num 
)

Function provided by host to provide a memcmp implementation

Simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]ptr1Pointer to block of memory.
[in]ptr2Pointer to block of memory.
[in]numNumber of bytes to compare.
Returns
Returns an integral value indicating the relationship between the content of the memory blocks: A zero value indicates that the contents of both memory blocks are equal. A value greater than zero indicates that the first byte that does not match in both memory blocks has a greater value in ptr1 than in ptr2 as if evaluated as unsigned char values; And a value less than zero indicates the opposite.
char* UAServer_Callback_strncpy ( char *  destination,
const char *  source,
size_t  num 
)

Function provided by host to provide a strncpy implementation

Simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]destinationPointer to the destination array where the content is to be copied.
[in]sourceC string to be copied.
[in]numMaximum number of characters to be copied from source. size_t is an unsigned integral type.
Returns
destination is returned.
void* UAServer_Callback_malloc ( size_t  size)

Function provided by host to provide a malloc implementation

Simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]sizeSize of the memory block, in bytes. size_t is an unsigned integral type.
Returns
On success, a pointer to the memory block allocated by the function. The type of this pointer is always void*, which can be cast to the desired type of data pointer in order to be dereferenceable. If the function failed to allocate the requested block of memory, a null pointer is returned.
void UAServer_Callback_free ( void *  ptr)

Function provided by host to provide a free implementation

Simply call the standard library implementation.

Where (UA_INCLUDE_ASYNC_OPS is > 0) this callback may be called on different threads. Ensure you provide whatever locking is necessary for your platform when enabling asynchronous operation.

Parameters
[in]ptrPointer to a memory block previously allocated with malloc, calloc or realloc.
Returns
None.